{template '_header'}
 
<div class="page-heading"> 
	
	<span class='pull-right'>
		
		{ifp 'perm.role.add'}
                            <a class="btn btn-primary btn-sm" href="{php echo webUrl('perm/role/add')}">添加新角色</a>
		{/if}
                
		<a class="btn btn-default  btn-sm" href="{php echo webUrl('perm/role')}">返回列表</a>
                
                
	</span>
	<h2><i class="fa fa-circle-o"></i>{if !empty($item['id'])}编辑{else}添加{/if}角色 <small>{if !empty($item['id'])}修改【{$item['rolename']}】{/if}</small></h2> 
</div>
 
    <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
        <input type="hidden" name="id" value="{$item['id']}" />

                <div class="form-group">
                    <label class="col-sm-1 control-label must">角色</label>
                    <div class="col-sm-11 col-xs-12">
                        {ife 'perm.role' $item}
                        <input type="text" name="rolename" class="form-control" value="{$item['rolename']}" data-rule-required="true" />
                        {else}
                        <div class='form-control-static'>{$item['rolename']}</div>
                        {/if}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">状态</label>
                    <div class="col-sm-11 col-xs-12">
                         {ife 'perm.role' $item}
                        <label class='radio-inline'>
                            <input type='radio' name='status' value=1' {if $item['status']==1}checked{/if} /> 启用
                        </label>
                        <label class='radio-inline'> 
                            <input type='radio' name='status' value=0' {if $item['status']==0}checked{/if} /> 禁用
                        </label>
                        <span class="help-block">如果禁用，则当前角色的操作员全部会禁止使用</span>
                        {else}
                        <div class='form-control-static'>{if $item['status']==1}启用{else}禁用{/if}</div>
                        {/if}
                    </div>
                </div>
                {template 'perm/perms'}
                {ife 'perm.role' $item}
                 {else}
                 <script language='javascript'>
                     $(function(){
                         $(':checkbox').attr('disabled',true);
                     })
                     </script>
                     {/if}
                    <div class="form-group"></div>
            <div class="form-group">
                    <label class="col-sm-1 control-label"></label>
                    <div class="col-sm-11 col-xs-12">
                           {ife 'perm.role' $item}
                            <input type="submit" value="提交" class="btn btn-primary"  />
                            
                        {/if}
                       <input type="button" name="back" onclick='history.back()' {ifp 'perm.role.add|perm.role.edit'}style='margin-left:10px;'{/if} value="返回列表" class="btn btn-default" />
                    </div>
            </div>
 
 
    
    </form>
 
{template '_footer'}
